import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description: 缺失的第一个正整数
 * User: wangxin
 * Date: 2024-12-22
 * Time: 21:08
 */
public class Test3 {
    public int minNumberDisappeared (int[] nums) {
        // write code here
        Map<Integer,Integer> map = new HashMap<Integer,Integer>();
        for(int i = 0;i < nums.length;i++){
            if(nums[i] > 0){
                map.put(nums[i],1);
            }
        }
        int j = 1;
        for(;j < Integer.MAX_VALUE;j++){
            if(!map.containsKey(j)){
                return j;
            }
        }
        return Integer.MIN_VALUE;
    }
}
